<template>
  <div class="posttable">
    <el-row style="margin-bottom: 10px;">
      <el-col :span="24" style="padding-right: 30px;padding-left: 40px;margin-top: 10px;">
        <el-row>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">推送客户</p>
              </el-col>
              <el-col>
                <p class="text">{{info.customerName}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">需求编号</p>
              </el-col>
              <el-col>
                <p class="text">{{info.requireNum}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title" v-if="!show">推送职位</p>
                <p class="title" v-if="show">需求名称</p>
              </el-col>
              <el-col>
                <p class="text">{{info.postName}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">职位级别</p>
              </el-col>
              <el-col>
                <p class="text">{{info.postLevel}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">所属区域</p>
              </el-col>
              <el-col>
                <p class="text">{{info.area}}</p>
              </el-col>
            </el-row>
          </el-col>

          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">性别</p>
              </el-col>
              <el-col>
                <p class="text">{{info.sex}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">姓名</p>
              </el-col>
              <el-col>
                <p class="text">{{info.name}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">出生年月</p>
              </el-col>
              <el-col>
                <p class="text">{{info.birthday}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">学历</p>
              </el-col>
              <el-col>
                <p class="text">{{info.education}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">毕业院校</p>
              </el-col>
              <el-col>
                <p class="text">{{info.college}}</p>
              </el-col>
            </el-row>
          </el-col>

          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">专业</p>
              </el-col>
              <el-col>
                <p class="text">{{info.speciality}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">毕业时间</p>
              </el-col>
              <el-col>
                <p class="text">{{info.graduationTime}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">联系方式</p>
              </el-col>
              <el-col>
                <p class="text">{{info.phone}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">联系邮箱</p>
              </el-col>
              <el-col>
                <p class="text">{{info.mail}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">离职状态</p>
              </el-col>
              <el-col>
                <p class="text">{{info.status}}</p>
              </el-col>
            </el-row>
          </el-col>

          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">到岗时间</p>
              </el-col>
              <el-col>
                <p class="text">{{info.entryTime}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">当前薪资</p>
              </el-col>
              <el-col>
                <p class="text">{{info.currentSalary}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title" v-if="!show">期望薪资</p>
                <p class="title" v-if="show">rate cate</p>
              </el-col>
              <el-col>
                <p class="text" v-if="!show">{{info.expectSalary}}k*{{info.expectSalaryNum}}</p>
                <p class="text" v-if="show">{{info.ratecode}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">最低薪资</p>
              </el-col>
              <el-col>
                <p class="text">{{info.miniSalary}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">方便面试时间</p>
              </el-col>
              <el-col>
                <p class="text">{{info.interviewTime}}</p>
              </el-col>
            </el-row>
          </el-col>

          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">工作年限</p>
              </el-col>
              <el-col>
                <p class="text">{{info.workSeniority}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">简历来源</p>
              </el-col>
              <el-col>
                <p class="text">{{info.origin}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">学历可查询网站</p>
              </el-col>
              <el-col>
                <p class="text">{{info.studentStatus}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title">资质证书</p>
              </el-col>
              <el-col>
                <p class="text">{{info.certificate}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col style="width:20%;" class="bot">
            <el-row>
              <el-col>
                <p class="title" v-if="!show">备注</p>
                <p class="title" v-if="show">语言能力</p>
              </el-col>
              <el-col>
                <p class="text">{{info.remark}}</p>
              </el-col>
            </el-row>
          </el-col>

          <el-col class="bot">
            <el-row>
              <el-col>
                <p class="title">项目经验</p>
              </el-col>
              <el-col>
                <p class="text">{{info.experience}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col class="bot">
            <el-row>
              <el-col>
                <p class="title">初步评价</p>
              </el-col>
              <el-col>
                <p class="text">{{info.initialEvaluation}}</p>
              </el-col>
            </el-row>
          </el-col>
          <el-col class="bot"  v-if="radio !== '待面试'" >
            <el-row>
              <el-col>
                <p class="title">技术面试备注</p>
              </el-col>
              <el-col>
                <p class="text">{{info.technicalEvalution}}</p>
              </el-col>
            </el-row>
          </el-col>
        </el-row>
      </el-col>
    </el-row>
    <!-- <el-col style="padding-left: 40px;margin-top: 10px;">
      <el-button class="save" @click="agree()">同意</el-button>
      <el-button class="canceL" @click="refuse()">退回</el-button>
    </el-col> -->

    <el-dialog
      title="通过审核"
      :visible.sync="agreedialogVisible"
      width="30%"
      :before-close="handleClose"
      class="deletedialog"
    >
      <div style="text-align: center">
        <i class="el-icon-warning" style="font-size: 20px;color: #fcb543;">
          <span style="font-size: 16px;color: #333;margin-left: 12px;">该简历是否通过审核？</span>
        </i>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button class="sure" :disabled="agreedis" round @click="agreepass">确 定</el-button>
        <el-button round @click="handleClose" class="cancel">取 消</el-button>
      </span>
    </el-dialog>

    <el-dialog
      class="addP"
      title="未通过审核"
      :visible.sync="refuseVisible"
      width="415px"
      :before-close="refuseBack"
    >
      <el-form :model="formL" :rules="rules" ref="formL" label-position="top">
        <el-form-item label="简历未通过审核的原因" :label-width="formLabelWidth" prop="rejectReason">
          <el-input v-model.trim="formL.rejectReason"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button
          class="sure"
          :disabled="refusedis"
          type="primary"
          round
          @click="refuseConfirm('formL')"
        >
          确
          定
        </el-button>
        <el-button class="cancel" round @click="refuseBack('formL')">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import axios from "axios";
import qs from "qs";
import moment from "moment";

export default {
  name: "uploaddetail",
  props: {
    detailCode: {
      type: Object
    },
     radio: {
      type: String
    }
  },
  data() {
    return {
      id: null,
      info: [],
      name: "",
      fullName: "",
      introduction: "",
      refuseVisible: false,
      refusedis: false,
      agreedis: false,
      agreedialogVisible: false,
      formLabelWidth: "120px",
      formL: {
        rejectReason: ""
      },
      rules: {
        rejectReason: [
          {
            required: true,
            message: "请填写简历未通过审核的原因",
            trigger: "blur"
          }
        ]
      },
      show: true
    };
  },
  created() {
    this.id = this.detailCode.id;
    this.getdetail();
  },
  filters: {
    formatDate: function(value) {
      return moment(value).format("YYYY-MM");
    }
  },
  methods: {
    getdetail() {
      axios
        .post(
          this.url + "/resumeUpload/getDetailById",
          qs.stringify({
            id: this.id
          })
        )
        .then(res => {
          this.unlogin(res.data.code);
          if (res.data.code == 200) {
            this.info = res.data.data;
            if (this.info.customerName == "港交所") {
              this.show = true;
            } else {
              this.show = false;
            }
          }
        });
    },
    agree() {
      this.agreedialogVisible = true;
      document.documentElement.style.overflow = "hidden";
    },
    agreepass() {
      this.agreedis = true;
      axios
        .post(this.url + "/resumeUpload/agreeResume", {
          id: this.id
        })
        .then(res => {
          this.unlogin(res.data.code);
          if (res.data.code == 200) {
            this.agreedis = false;
            this.agreedialogVisible = false;
            document.documentElement.style.overflow = "auto";
            this.$emit("getapprovalList");
          }
        });
    },
    refuse() {
      this.refuseVisible = true;
      document.documentElement.style.overflow = "hidden";
    },
    refuseConfirm(formName) {
      this.$refs[formName].validate(valid => {
        if (valid) {
          this.refusedis = true;
          axios
            .post(
              this.url + "/resumeUpload/rejectResume",
              qs.stringify({
                id: this.id,
                rejectReason: this.formL.rejectReason
              })
            )
            .then(res => {
              this.unlogin(res.data.code);
              if (res.data.code == 200) {
                this.refusedis = false;
                this.refuseVisible = false;
                document.documentElement.style.overflow = "auto";
                this.$emit("getapprovalList");
                this.$refs[formName].resetFields();
              }
            });
        }
      });
    },
    //关闭未选择客户的弹出框
    handleClose(done) {
      this.agreedialogVisible = false;
      document.documentElement.style.overflow = "auto";
    },
    refuseBack(formName) {
      this.$refs[formName].resetFields();
      this.refuseVisible = false;
      document.documentElement.style.overflow = "auto";
    }
  }
};
</script>
<style scoped>
.title {
  color: #757575;
  margin-bottom: 10px;
  font-size: 14px;
}

.text {
  color: #333333;
  font-weight: 700;
  font-size: 14px;
  word-break: break-all;
  white-space: pre-line;
}

.bot {
  margin-bottom: 30px;
}

.Line {
  border: 0.5px solid #e8e8e8;
  margin-bottom: 30px;
}
.save {
  width: 150px;
  height: 40px;
  font-size: 16px;
  color: #fff;
  border-radius: 4px;
  margin-right: 43px;
  background: linear-gradient(to bottom, #5696f8 0%, #4e6ef5 100%);
}

.canceL {
  width: 150px;
  height: 40px;
  border: 1px solid #4e6ef5;
  font-size: 16px;
  font-weight: 500;
  color: #4e6ef5;
}
.other {
  color: #1198ff;
  cursor: pointer;
  text-decoration: none;
}
@media screen and (min-width: 1200px) and (max-width: 1900px) {
  .word {
    word-break: break-all;
    width: 200px;
  }
}
</style>
